function isObject(obj) {
    if (typeof obj === 'object' && obj !== null) {
        return true;
    }
}

function isEqual(obj1, obj2) {
    if (!isObject(obj1) || !isObject(obj2)) {
        return obj1 === obj2;
    }
    if (obj1 === obj2) {
        return true
    }
    let len1 = Object.keys(obj1);
    console.log(len1);

    let len2 = Object.keys(obj2);
    if (len1.length !== len2.length) {
        return false;
    }


    for (let key in obj1) {
        let res = isEqual(obj1[key], obj2[key]);
        if (!res) {
            return false;
        }
    }
    return true;
}



const obj1 = {
    a: 100,
    b: 200,
    c: {
        d: 8,
        e: 8
    }
}
const obj2 = {
    b: 200,
    c: {
        d: 8,
        e: 9
    },
    k: 100
}

const arr1 = [1, 2, 3]
const arr2 = [1, 2, 3]


console.log(isEqual(obj1, obj2));
console.log(isEqual(arr1, arr2));
console.log(isEqual(1, 2));